package com.lyl.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @author lylbell
 * @date 2021-05-27 13:50
 */
@RestController
public class ConsumerController {

    private static final String SERVICE_URL = "http://cloud-provider-payment";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/payment/consul")
    public String consumerConsul() {
        return restTemplate.getForObject(SERVICE_URL + "/payment/consul",String.class);
    }
}
